package com.yn.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum UserBillStatusEnum {

    PENDING(0, "待确定"),
    VALID(1, "有效"),
    INVALID(-1, "无效");

    ;

    private Integer code;

    private String name;

    public static UserBillStatusEnum getByCode(Integer code) {
        if(null == code) {
            return null;
        }
        for(UserBillStatusEnum auditStatusEnum : UserBillStatusEnum.values()) {
            if(auditStatusEnum.getCode() == code) {
                return auditStatusEnum;
            }
        }
        return null;
    }

}